import request from '@/utils/request'

// 查询项目方法包列表
export function listPackage(query) {
  return request({
    url: 'lims/store/package/list',
    method: 'get',
    params: query
  })
}

// 查询项目方法包列表
export function treePackage(query) {
  return request({
    url: 'lims/store/package/tree',
    method: 'get',
    params: query
  })
}

// 查询检测项目组列表
export function listJcxmGroup(query) {
  return request({
    url: '/lims/store/package/jcxmGroupList',
    method: 'get',
    params: query
  })
}

// 查询项目方法包列表
export function listAllPackage(query) {
  return request({
    url: 'lims/store/package/packageList',
    method: 'get',
    params: query
  })
}

export function listRightPackage(query) {
  return request({
    url: 'lims/store/package/page/jcxmList',
    method: 'get',
    params: query
  })
}

export function listRightPackage1(query) {
  return request({
    url: 'lims/store/package/jcxmList',
    method: 'get',
    params: query
  })
}

export function listMethodJcxm(query) {
  return request({
    url: 'lims/store/package/packageJcxmList',
    method: 'get',
    params: query
  })
}

// 查询项目方法包详细
export function getPackage(packageId) {
  return request({
    url: 'lims/store/package/' + packageId,
    method: 'get'
  })
}

// 新增项目方法包
export function addPackage(data) {
  return request({
    url: 'lims/store/package',
    method: 'post',
    data: data
  })
}

export function addJcxm(data) {
  return request({
    url: '/lims/store/package/addJcxm',
    method: 'post',
    data: data
  })
}


// 修改项目方法包
export function updatePackage(data) {
  return request({
    url: 'lims/store/package',
    method: 'put',
    data: data
  })
}

// 清空已选择的
export function clearSelected(packageId) {
  return request({
    url: '/lims/store/package/deleteAll/' + packageId,
    method: 'delete',
  })
}

// 查找选择的检测项目
export function seletedJcxmList(packageId) {
  return request({
    url: '/lims/store/package/selectJcxmList/' + packageId,
    method: 'get'
  })
}
// 删除项目方法包
export function delPackage(packageId) {
  return request({
    url: 'lims/store/package/delete/' + packageId,
    method: 'delete'
  })
}

// 复制项目方法包
export function copyPackage(packageId) {
  return request({
    url: 'lims/store/package/copyPackage/' + packageId,
    method: 'post'
  })
}

// 删除指定的检测项目
export function delPackageJcxm(packageId,mJIds) {
  return request({
    url: '/lims/store/package/deleteJcxm/' + packageId + '/' + mJIds,
    method: 'delete'
  })
}



